package com.unicomcz.autojobs.autoreport;
import java.sql.*;

public class sendSMS {
	Connection        conn  = null;
	CallableStatement cstmt = null;
	
	public sendSMS() throws Exception{
		Class.forName("oracle.jdbc.driver.OracleDriver");
		conn  = DriverManager.getConnection("jdbc:oracle:thin:@130.57.7.224:1521:yydb","sms","sms1234");
		cstmt = conn.prepareCall("{call sms.send8980(?,?,?)}");
	}
	
	public void send(String dhhm,String msg) throws Exception{
		cstmt.setString(1,dhhm);
		cstmt.setString(2,msg);
		cstmt.registerOutParameter(3,Types.INTEGER);
		
		cstmt.executeQuery();
		
		int rs = cstmt.getInt(3);
	}
	
	public void close() throws Exception{
		conn.close();
	}
}